# @Time : 2020/9/2 14:09
# @Author : Fioman 
# @Phone : 13149920693
import cv2 as cv
import numpy as np

source = cv.imread("pic/31.png")
template = cv.imread("pic/32.png")

tmpH, tmpW = template.shape[:2]

result = cv.matchTemplate(source, template, cv.TM_CCOEFF)
minVal, maxVal, minLoc, (x, y) = cv.minMaxLoc(result)

cv.rectangle(source, (x, y), (x + tmpW, y + tmpH), (0, 255, 0), 2)

cv.imshow("Sorce", source)
cv.imshow("Template", template)
cv.waitKey(0)
